<?php

	$link = $_GET['link'];
	$sql = "select clicks from ad_media where link = '$link'";
	$result = mysql_query($sql);
	$clicks = current(mysql_fetch_array($result));
	$clicks +=1;
	$sql = "update ad_media set clicks=$clicks where link='$link'";
	mysql_query($sql) or die(mysql_error());
	header("location:$link");
	
	

?>